module ApplicationHelper
  
  @@flux_validator_css = File.join(File.dirname(__FILE__), File.join('..', '..', '..', '..', 'public', 'stylesheets', 'flux_validator.css'))
  
  def flux_validator_for(form_selector = 'form', options = {})
    html = ""
    html += stylesheet_link_tag('flux_validator') + "\n" if File.exist?(@@flux_validator_css)
    html += javascript_include_tag('flux_validator') + "\n"
    html += javascript_tag("Event.addBehavior({ '#{form_selector}': FluxValidator.Validate });") + "\n"
  end
  
end